<div class="page-body">
    <div class="row">
        <div class="widget">
            <div class="widget-body">
                <div id="horizontal-form">
                    <form class="form-horizontal" role="form"
                          action="{:U('doEdit',array('order_id'=>I("get.order_id")))}"
                          method="post" enctype="multipart/form-data">
                        <div class="form-group">
                            <label class="col-sm-3 control-label no-padding-right">订单号：</label>
                            <div class="col-sm-3">
                                <input type="text" name="order_id" class="form-control" value="{:I('get.order_id')}" disabled="disabled" required>
                            </div>
                        </div>
                        <div class="form-group   ">
                            <label class="col-sm-3 control-label no-padding-right">配送方式：</label>
                            <div class="col-sm-3">
                                <select class="form-control" name="type" onchange="selectype()">
                                    <option value="1" <if condition="$d.type eq 1">selected</if> >新华书店</option>
                                    <option value="2" <if condition="$d.type eq 2">selected</if> >快递公司</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group delivery-type delivery-type-1">
                            <label class="col-sm-3 control-label no-padding-right">配送人员：</label>
                            <div class="col-sm-3">
                                <select class="form-control" name="man_id" onchange="selectman()">
                                    <volist name="dman" id="vo">
                                        <if condition="$vo['man_id'] eq $d['man_id']">
                                            <option value="{$vo.man_id}" data-phone="{$vo.phone}" data-name="{$vo.name}" selected>{$vo.name}</option>
                                            <else />
                                            <option value="{$vo.man_id}" data-phone="{$vo.phone}" data-name="{$vo.name}" >{$vo.name}</option>
                                        </if>

                                    </volist>
                                </select>
                            </div>
                        </div>
                        <div class="form-group delivery-type delivery-type-1">
                            <label class="col-sm-3 control-label no-padding-right">电话：</label>
                            <div class="col-sm-3">
                                <input type="hidden" name="name" class="form-control" value="" required>
                                <input type="text" name="phone" class="form-control" value="" required>
                            </div>
                        </div>
                        <div class="form-group delivery-type delivery-type-2">
                            <label class="col-sm-3 control-label no-padding-right">快递名称：</label>
                            <div class="col-sm-3">
                                <input type="text" name="delivery_name" class="form-control" value="{$d.content.name}">
                            </div>
                        </div>
                        <div class="form-group delivery-type delivery-type-2">
                            <label class="col-sm-3 control-label no-padding-right">运单号：</label>
                            <div class="col-sm-3">
                                <input type="text" name="order_num" class="form-control" value="{$d.content.order_num}">
                            </div>
                        </div>
                        <div class="form-group  ">
                            <div class="col-sm-offset-3 col-sm-10">
                                <button type="submit" class="btn btn-primary">提 交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    selectype();
    function selectype(){
        var $type=$("select[name=type]").val();
        $(".delivery-type").hide();
        $(".delivery-type-"+$type).show();
    }
    selectman();
    function selectman(){
        var $man=$("select[name=man_id]").find("option:selected");
        $name=$man.data("name");
        $phone=$man.data("phone");
        $("input[name=name]").val($name);
        $("input[name=phone]").val($phone);
    }
</script>